import Vue from "vue";
import VueRouter from "vue-router";

import index from '@/components/index'
import login from '@/views/login'
import user from '@/views/user'
import emp from '@/views/emp'
import category from '@/views/category'
import moneyRecord from '@/views/moneyRecord'
import order from '@/views/order'
import swiper from '@/views/swiper'
import checkReview from "../views/checkReview";
import orderDetail from "../views/orderDetail";
import checkEmp from "../views/checkEmp";
import checkEmpInfo from "../views/checkEmpInfo";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: login,
  },
  {
    path: "/index",
    redirect: "/user",
    component: index,
    name: "首页",
    children:[
        {
            path: "/user",
            component: user,
            name: "用户中心"
        },
        {
            path: "/emp",
            component: emp,
            name: "账号管理"
        },
        {
            path: "/checkEmp",
            component: checkEmp,
            name: "员工审核"
        },

        {
            path: "/moneyRecord",
            component: moneyRecord,
            name: "平台流水",
        },
        {
            path: "/checkReview",
            component: checkReview,
            name: "评论审核",
        },
        {
            path: "/category",
            component: category,
            name: "产品分类"
        },
        {
            path: "/order",
            component: order,
            name: "订单中心"
        },
        {
            path: "/orderDetail",
            component: orderDetail,
            name: "订单详情"
        },
        {
            path: "/swiper",
            component: swiper,
            name: "轮播图管理"
        },
        {
            path: "/checkEmpInfo",
            component: checkEmpInfo,
            name: "审核员工详情"
        }
    ]
  }

];

const router = new VueRouter({
  routes,
});

export default router;
